/*
 * 百度在线网络技术（北京）有限公司拥有本软件版权2021并保留所有权利。
 * Copyright 2021, Baidu.com,Inc 2:Baidu Online Network Technology (Beijing) Co.,Ltd,
 * All rights reserved.
 */

package com.azdebugit.cas.test.reentrantlock;

public class ExecuteReentrantLockConditionDemo {

    public static void main(String[] args) {
        final ReentrantLockConditionDemo rd = new ReentrantLockConditionDemo();
        // 创建1个消费者线程
        for (int i = 0; i < 1; i++) {
            
            new Thread(new Runnable() {
                public void run() {
                    try {
                        rd.get();
                    } catch (InterruptedException e) {

                        e.printStackTrace();
                    }
                }
            }).start();
        }

        // 创建10个生产者线程
        for (int i = 0; i < 10; i++) {
            new Thread(new Runnable() {
                public void run() {
                    try {
                        rd.put("bread");
                    } catch (InterruptedException e) {

                        e.printStackTrace();
                    }
                }
            }).start();
        }

    }

}